<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<script type="text/javascript">
    $(function() {

    });
    var mallProductManageListModule = (function(){
        /*启用禁用*/
        var useOrDisable = function(id, type){
            var url = null;
            var msg = null;
            if(type == 1){//启用
                url = 'mallProductController.do?update&id='+id+'&isdelete=0';
                msg = '确定启用该商品?'
            }else{
                url = 'mallProductController.do?update&id='+id+'&isdelete=1';
                msg = '确定禁用该商品?'
            }
            createdialog('确认', msg, url, 'mallProductManageList');
        }
        var module = {
            init : function(){

            },
            //启用
            use : function(id){
                useOrDisable(id, 1);
            },
            //禁用
            disable : function(id){
                useOrDisable(id, 0);
            },
            //查看
            look : function(id){
                window.document.location.href = 'mallProductController.do?subsidyview&look=true&productId='+id;
            },
            //编辑
            edit : function(id){
                window.document.location.href = 'mallProductController.do?subsidyview&look=false&productId='+id;
            }

        }
        return module;
    })();
</script>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
   <t:datagrid name="mallProductManageList" title="商品列表" actionUrl="mallProductController.do?managedatagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="编号" field="id" hidden="true"></t:dgCol>
   <t:dgCol title="商品编码" field="productcode"   width="120"></t:dgCol>
   <%--<t:dgCol title="sellerproductcode" field="sellerproductcode"   width="120"></t:dgCol>--%>
   <t:dgCol title="商品名称" field="productname" query="true"  width="120"></t:dgCol>
   <t:dgCol title="商品图片" field="thumbnailurl" image="true" imageSize="50,50"  width="50"></t:dgCol>
  <%-- <t:dgCol title="shopid" field="shopid" hidden="true"  width="120"></t:dgCol>
   <t:dgCol title="productcategoryid" hidden="true" field="productcategoryid"   width="120"></t:dgCol>
   <t:dgCol title="description" field="description"   width="120"></t:dgCol>--%>
   <t:dgCol title="所属店铺" field="shopname" query="true"  width="120"></t:dgCol>
   <t:dgCol title="商品类型" field="saletype" query="true" replace="线上商品_0,本地商品_1,充值商品_2"  width="120"></t:dgCol>
   <%--<t:dgCol title="关键字" field="keywords" hidden="true"  width="120"></t:dgCol>--%>
   <t:dgCol title="商品原价" field="originalprice"   width="50"></t:dgCol>
   <t:dgCol title="商品现价" field="price"   width="50"></t:dgCol>
  <%-- <t:dgCol title="discount" field="discount"   width="120"></t:dgCol>
   <t:dgCol title="stockamount" field="stockamount"   width="120"></t:dgCol>
   <t:dgCol title="minmoney" field="minmoney"   width="120"></t:dgCol>
   <t:dgCol title="maxmoney" field="maxmoney"   width="120"></t:dgCol>--%>
   <t:dgCol title="添加时间" field="createtime" formatter="yyyy-MM-dd hh:mm:ss"  width="120"></t:dgCol>
   <t:dgCol title="上架时间" field="startdatetime" formatter="yyyy-MM-dd hh:mm:ss"  width="120"></t:dgCol>
   <t:dgCol title="最后修改时间" field="enddatetime" formatter="yyyy-MM-dd hh:mm:ss"  width="120"></t:dgCol>
   <t:dgCol title="补贴类型" field="subsidytype" replace="不补贴_0,金额_1,折扣_2,满减_3"  width="120"></t:dgCol>
   <t:dgCol title="补贴金额" field="strSubsidyval"   width="120"></t:dgCol>
   <t:dgCol title="商品状态" field="status" replace="未上架_0,在售_1,下架_2" query="true"  width="120"></t:dgCol>
   <t:dgCol title="平台约束" field="isdelete" query="true" replace="启用_0,禁用_1"  width="120"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
   <t:dgFunOpt funname="mallProductManageListModule.look(id)" title="查看" ></t:dgFunOpt>
   <t:dgFunOpt funname="mallProductManageListModule.edit(id)" title="编辑" ></t:dgFunOpt>
   <t:dgFunOpt funname="mallProductManageListModule.use(id)" title="启用" exp="isdelete#eq#1"></t:dgFunOpt>
   <t:dgFunOpt funname="mallProductManageListModule.disable(id)" title="禁用" exp="isdelete#eq#0"></t:dgFunOpt>
  <%-- <t:dgCol title="hasspec" field="hasspec"   width="120"></t:dgCol>
   <t:dgCol title="defaultspecid" field="defaultspecid"   width="120"></t:dgCol>exp="auditStatus#eq#1" --%>
  </t:datagrid>
  </div>
 </div>